package czk.concrent.resultrunnable;

/**
 * 异步回调
 * 实现runnable接口返回值
 *
 * @Author:ChenZhangKun
 * @Date: 2021/9/3 13:57
 */
public class Client {
    public static void main(String[] args) throws InterruptedException {
        // 定义接收实体类
        TaskResult task = new TaskResult();
        // 定义线程
        TaskHandler taskHandler = new TaskHandler();
        TaskExecutor taskExecutor = new TaskExecutor(taskHandler, task);
        // 执行方法
        Thread t1 = new Thread(taskExecutor);
        t1.start();
        t1.join();
        // 打印
        System.out.println(task);
    }
}
